package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ProjectDetailMapper;
import com.ruoyi.system.domain.ProjectDetail;
import com.ruoyi.system.service.IProjectDetailService;

import javax.annotation.Resource;

/**
 * 竞标项目详情Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-03
 */
@Service
public class ProjectDetailServiceImpl implements IProjectDetailService {
    @Resource
    private ProjectDetailMapper projectDetailMapper;

    /**
     * 查询竞标项目详情
     *
     * @param id 竞标项目详情主键
     * @return 竞标项目详情
     */
    @Override
    public ProjectDetail selectProjectDetailById(Long id) {
        return projectDetailMapper.selectProjectDetailById(id);
    }

    /**
     * 查询竞标项目详情列表
     *
     * @param projectDetail 竞标项目详情
     * @return 竞标项目详情
     */
    @Override
    public List<ProjectDetail> selectProjectDetailList(ProjectDetail projectDetail) {
        return projectDetailMapper.selectProjectDetailList(projectDetail);
    }

    /**
     * 新增竞标项目详情
     *
     * @param projectDetail 竞标项目详情
     * @return 结果
     */
    @Override
    public int insertProjectDetail(ProjectDetail projectDetail) {
        projectDetail.setCreateTime(DateUtils.getNowDate());
        return projectDetailMapper.insertProjectDetail(projectDetail);
    }

    /**
     * 修改竞标项目详情
     *
     * @param projectDetail 竞标项目详情
     * @return 结果
     */
    @Override
    public int updateProjectDetail(ProjectDetail projectDetail) {
        projectDetail.setUpdateTime(DateUtils.getNowDate());
        return projectDetailMapper.updateProjectDetail(projectDetail);
    }

    /**
     * 批量删除竞标项目详情
     *
     * @param ids 需要删除的竞标项目详情主键
     * @return 结果
     */
    @Override
    public int deleteProjectDetailByIds(Long[] ids) {
        return projectDetailMapper.deleteProjectDetailByIds(ids);
    }

    /**
     * 删除竞标项目详情信息
     *
     * @param id 竞标项目详情主键
     * @return 结果
     */
    @Override
    public int deleteProjectDetailById(Long id) {
        return projectDetailMapper.deleteProjectDetailById(id);
    }
}
